package com.mp.controller;

import com.alibaba.fastjson.JSONObject;
import com.mp.feign.ProviderFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RestClientController {

    @Autowired
    private ProviderFeign providerFeign;

    @RequestMapping(value = "/client/getHost", method = RequestMethod.GET)
    public String getHost(@SpringQueryMap JSONObject params) {
        JSONObject result = providerFeign.queryHost(params);

        return result.toJSONString();
    }
}
